#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
# Filename @ class_timeslong.py
# Author @ Huoty
# Create date @ 2014-10-16 09:43:16
# Description @ 
# *************************************************************

import time

class timeslong(object):
    def __init__(self,func):
        self.f = func
    def __call__(self):
        start = time.clock()
        print "It's time starting ! "
        self.f()
        print "It's time ending ! "
        end = time.clock()
        #return "It's used : %s ." % (end - start)
        return "hello world %s" % "khy"

# Script starts from here

@timeslong
def f():
    y = 0
    for i in range(10):
        y = y + i + 1
        time.sleep(0.5)
        print y
    #return y
print f()
